<?php
session_start();
require("../conn.php");
		 $link=($_POST['link']);
		 $article_id = $_POST['article_id'];
		 if(isset($_POST['disp']))
		 $show=1;
		 else
		 $show=0;
		 
		 
$sql=sprintf("insert into tblhome_image (tblhome_image.link, tblhome_image.article_id, tblhome_image.show) values('%s','%s','%s')", $link, $article_id, $show);	
																												
			$kq=mysql_query($sql)or die(mysql_error());
	 
	
	
			if(!$kq)
			{ 
				?>
				<script language="javascript">
				alert("Thêm ảnh không thành công!");
			
				</script>
				<?php
					header("Location:/image");
			}
			else
			{
				
			   
			header("Location:../image");
				
			}

		

?>
